// Copyright (C) joyinter
// All rights reserved.
// 
// Author : Jiang Li
// Date   : 2004-11-11

#ifndef __SVR_ASYNCOBJ_H_COMMON_SVR_BASE__
#define __SVR_ASYNCOBJ_H_COMMON_SVR_BASE__

#pragma once

#include <common/base/refdata.h>
#include <common/base/mempool.h>

namespace JoyServer
{

class CJoyServer;

class CJoyAsyncObject : public CJoyRefData
{
protected:
    friend class CJoyAsyncExec;

    CJoyAtomCount m_asyncState;
public:
#   include <common/base/mempoolinc.h>
    virtual void Cancel();
    virtual void Execute();

    virtual void OnExecute() = 0;
public:
    CJoyAsyncObject();
    virtual ~CJoyAsyncObject();
};


} // namespace JoyServer

#endif  // __SVR_ASYNCOBJ_H_COMMON_SVR_BASE__